unit uInsteadTime;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
  cxLookAndFeelPainters, cxContainer, cxEdit, dxSkinsCore, dxSkinBlack,
  dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
  dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
  dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
  dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins,
  dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
  dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
  dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinPumpkin, dxSkinSeven,
  dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
  dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
  dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
  dxSkinXmas2008Blue, Vcl.Menus, cxLabel, Vcl.StdCtrls, cxButtons, Vcl.ActnList,
  cxTextEdit, cxMaskEdit, cxSpinEdit, cxTimeEdit, cxGroupBox;

type
  TFrmInsteadTime = class(TForm)
    cxGroupBox1: TcxGroupBox;
    cxGroupBox2: TcxGroupBox;
    teBegin: TcxTimeEdit;
    teEnd: TcxTimeEdit;
    ActionList: TActionList;
    actSave: TAction;
    actCancel: TAction;
    cxButton13: TcxButton;
    cxButton14: TcxButton;
    cxLabel1: TcxLabel;
    cxLabel2: TcxLabel;
    procedure actSaveExecute(Sender: TObject);
    procedure actCancelExecute(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmInsteadTime: TFrmInsteadTime;
  function FrmInsteadTimeShow(var bTime,eTime:string):boolean;

implementation

uses
  ucommFunction;

{$R *.dfm}

function FrmInsteadTimeShow(var bTime,eTime:string):Boolean;
begin
  Application.CreateForm(TFrmInsteadTime,FrmInsteadTime);
  with FrmInsteadTime do
  begin
    teBegin.EditValue:=bTime;
    teEnd.EditValue:=eTime;
    if ShowModal=mrOk then
    begin
      bTime:=VarToStr(teBegin.EditValue);
      eTime:=VarToStr(teEnd.EditValue);
      Result:=True;
    end else
      Result:=False;
    FreeAndNil(FrmInsteadTime);
  end;
end;

procedure TFrmInsteadTime.actCancelExecute(Sender: TObject);
begin
  Self.ModalResult:=mrCancel;
end;

procedure TFrmInsteadTime.actSaveExecute(Sender: TObject);
begin
  Self.ModalResult:=mrOk;
end;

procedure TFrmInsteadTime.FormCreate(Sender: TObject);
begin
  pSetCaption(Self);
end;

end.
